#!/usr/bin/env python3
# coding:utf-8
import sys
from loguru import logger

# 1.移除 终端/屏幕 输出
logger.remove(0)

# 2.添加 终端/屏幕 输出
log_format = (
    "<green>{time:YYYY-MM-DD HH:mm:ss.SS}</green> |"
    "<level>{level: <5}</level> |"
    "<cyan>{function}:{line}</cyan>- <level>{message}</level>"
)
logger.add(
    sys.stderr,
    level="INFO",
    format=log_format,
    colorize=True,
)
logger.debug("this is a debug message")
logger.info("this is a info message")
logger.warning("this is a warning message")
